﻿const libary = {
    async gongsiName(gongsi) {
        let gongsiArr = [];
        gongsiArr.push(gongsi)
        let gongsiTitle, grade;
        switch (gongsi) {
            case "托盘":
                gongsiTitle = "物流装备事业部";
                grade = 3;
                break;
            case "钣喷中心":
                gongsiTitle = "物流装备事业部";
                grade = 3;
                break;
            case "装备管理":
                gongsiTitle = "物流装备事业部";
                grade = 3;
                break;
            case "装备经营管理部":
                gongsiTitle = "物流装备事业部";
                grade = 3;
                break;
            case "化工":
                gongsiTitle = "其它";
                grade = 3;
                break;
            case "数巢科技":
                gongsiTitle = "其它";
                grade = 3;
                break;
            case "翼程":
                gongsiTitle = "物流装备事业部";
                grade = 3;
                break;
            case "铁储分公司":
                gongsiTitle = "经营管理中心部门";
                grade = 3;
                break;
            case "中心经营管理部":
                gongsiTitle = "经营管理中心部门";
                grade = 3;
                break;
            case "仓储分公司":
                gongsiTitle = "经营管理中心部门";
                grade = 3;
                break;
            case "物资配送公司":
                gongsiTitle = "经营管理中心部门";
                grade = 3;
                break;
            case "物流成本部":
                gongsiTitle = "经营管理中心部门";
                grade = 3;
                break;
            case "生产经营部":
                gongsiTitle = "经营管理中心部门";
                grade = 3;
                break;
            case "伊犁项目部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "发展经营管理部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "中化泉州项目部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "大唐阜新项目部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "包头项目部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "同程仓储":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "同程管理":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "同程配送":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "宁夏同程":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "武汉项目部":
                gongsiTitle = "物流发展事业部";
                break;
            case "淮南项目部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "中科湛江项目部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "物流发展事业部":
                gongsiTitle = "物流发展事业部";
                grade = 2;
                break;
            case "物流装备事业部":
                gongsiTitle = "物流装备事业部";
                grade = 2;
                break;
            case "经营管理中心":
                gongsiTitle = "经营管理中心部门";
                grade = 2;
                break;
            case "商检":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "武汉合资项目部":
                gongsiTitle = "物流发展事业部";
                grade = 3;
                break;
            case "总部经营管理部":
                gongsiTitle = "总部费用";
                grade = 3;
                break;
            case "管理费用":
                gongsiTitle = "总部费用";
                grade = 3;
                break;
            case "总部费用":
                gongsiTitle = "总部费用";
                grade = 2;
                break;
            case "其它":
                gongsiTitle = "其它";
                grade = 2;
                break;
            case "金石物流":
                gongsiTitle = "金石物流";
                grade = 1;
                break;
            default:
                break;
        }
        gongsiArr.push(gongsiTitle);
        gongsiArr.push(grade);
        return gongsiArr;
    },
    async renderBiaotou1(arrHhh, gongsiName, year, month, grade) {
        let gongshiBuMen = gongsiName[0];
        let gongshiName = gongsiName[1];
        renderTitle = {};
        var dangqianYear = Number(year);
        var dangqianMonth = Number(month);
        if (month > 1) {
            renderTitle["z150"] = `${gongshiName + dangqianYear}年${dangqianMonth}月份${grade}级巴经营会计损益表（${gongshiBuMen}）`;
            renderTitle["z151"] = `公司${dangqianYear - 1}年度`;
            renderTitle["z152"] = `实际（${dangqianMonth}月份）`;
            renderTitle["z153"] = `实际（1-${dangqianMonth}月份累计）`;
            renderTitle["z154"] = `公司${dangqianYear}年度`;
            renderTitle["z155"] = `实际 （1-${dangqianMonth}月份累计）`;
            renderTitle["z156"] = `${dangqianYear}年${dangqianMonth - 1}月份`;
            renderTitle["z157"] = `${dangqianYear}年${dangqianMonth}月份`;
            dangqianYear = month == 12 ? Number(year) + 1 : Number(year);
            dangqianMonth = month == 12 ? 1 : Number(month);
            renderTitle["z158"] = `${dangqianYear}年${dangqianMonth}月份`;
        } else {
            renderTitle["z150"] = `${gongshiName + dangqianYear}年${dangqianMonth}月份${grade}级巴经营会计损益表（${gongshiBuMen}）`
            renderTitle["z151"] = `公司${dangqianYear - 1}年度`;
            renderTitle["z152"] = `实际（${dangqianMonth}月份）`;
            renderTitle["z153"] = `实际（1-${dangqianMonth}月份累计）`;
            renderTitle["z154"] = `公司${dangqianYear}年度`;
            renderTitle["z155"] = `实际 （1-${dangqianMonth}月份累计）`;
            renderTitle["z156"] = `${dangqianYear - 1}年12月份`;
            renderTitle["z157"] = `${dangqianYear}年${dangqianMonth}月份`;
            renderTitle["z158"] = `${dangqianYear}年${Number(dangqianMonth) + 1}月份`
        }
        return Object.assign(arrHhh, renderTitle);
    }
}
module.exports = libary;
